<template>
  <div class="search">
    <van-nav-bar
      title="搜索中心"
      left-arrow
      @click="$router.back()"
    ></van-nav-bar>

    <!-- 搜索框 -->
    <van-search
      v-model="keyword"
      show-action
      shape="round"
      placeholder="请输入搜索关键词"
      @input="inputFn"
      @search="onSearch(keyword)"
    >
      <template #action>
        <div @click="onSearch">搜索</div>
      </template>
    </van-search>

    <!-- 推荐 -->
    <van-cell-group>
      <van-cell title="华为" icon="search"></van-cell>
      <van-cell title="鸿蒙" icon="search"></van-cell>
    </van-cell-group>

    <!-- 历史记录 -->
    <van-cell-group>
      <van-cell title="历史记录"></van-cell>
      <van-cell title="单元格">
        <van-icon name="close" />
      </van-cell>
      <van-cell title="单元格">
        <van-icon name="close" />
      </van-cell>
    </van-cell-group>
  </div>
</template>

<script>
export default {
  name: 'Search',
  data() {
    return {
      keyword: ''
    }
  },
  methods: {
    imputFn()
    onSearch() {}
  }
}
</script>

<style></style>
